﻿using UnityEngine;
using UnityEngine.UI;

namespace CounterApp.PureMVC
{
    public class CounterAppView : MonoBehaviour
    {
        public Button BtnAdd { get; set; }

        public Button BtnSub { get; set; }
        
        public Text NumberText { get; set; }


        void Awake()
        {
            BtnAdd = transform.Find("BtnAdd").GetComponent<Button>();
            BtnSub = transform.Find("BtnSub").GetComponent<Button>();
            NumberText = transform.Find("NumberText").GetComponent<Text>();
        }

        void Start()
        {
            App.Instance.RegisterMediator(new CounterAppViewMediator(CounterAppViewMediator.NAME, this));
        }

        void OnDestroy()
        {
            App.Instance.RemoveMediator(CounterAppViewMediator.NAME);
        }
    }
}